import StorageUtil from '@util/StorageUtil';

export default class TokenUtil {
  static TOKEN_NAME = 'token';

  static saveToken = token => {
    StorageUtil.save(TokenUtil.TOKEN_NAME, token);
  };

  static getToken = async () => {
    try {
      return await StorageUtil.get(TokenUtil.TOKEN_NAME);
    } catch (e) {
      console.error('获取token失败' + e);
    }
    return '';
  };

}
